<template>
  <!-- 公共板块头部 -->
  <div class="panel_header">
    <van-cell border :title="title">
      <div v-if="needRight" slot="right-icon" class="panel_header_right" @click="rightClick()">{{ rightText }}</div>
    </van-cell>
  </div>
</template>
<script>
export default {
  name: 'PanelHeader',
  props: {
    titel: {
      type: String,
      default: '标题'
    },
    rightText: {
      type: String,
      default: '更多'
    },
    needRight: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    rightClick () {
      this.$emit('rightClick')
    }
  }
}
</script>
<style lang="scss">
.panel_header{
 &_right{
     color: #3B7BE6;
     font-size: 14px;
 }
 .van-cell{
     padding: 0 15px;
     height: 50px;
     line-height: 50px;
 }
}
.panel_header:after{
    content: '';
    position: absolute;
    bottom: 0;
    left:0;
    width: 100%;
    height: 1px;
    background-color: #F0F0F0;
    transform: scale(1,5);
}
</style>
